import http from "@/utils/http.js"

export const login = (phone,password) => {
	return http({
		url:"/client/login/login",
		data:{
			"phone":phone,
			"password":password,
		}
	})
}

/**
 * 验证手机号是否注册
 */
export const verifyPhone = (phone) => {
	return http({
		url:"/client/login/verifyPhone",
		data:{
			"phone":phone,
		}
	})
}

/**
 * 请求验证码
 */
export const sendCode = (phone,type) => {
	return http({
		url:"/client/login/sendCode",
		data:{
			"phone":phone,
			"type":type,
		}
	})
}

/**
 * 用户注册
 */
export const register = (phone,password,code) => {
	return http({
		url:"/client/login/register",
		data:{
			"phone":phone,
			"password":password,
			"code":code,
		}
	})
}

/**
 * 用户忘记密码
 */
export const forgot = (phone,newPassword,code) => {
	return http({
		url:"/client/login/forgot",
		data:{
			"phone":phone,
			"newPassword":newPassword,
			"code":code,
		}
	})
}